how do you search for how many times a character appears in user input on c sharp

88

how do you search for how many times a character appears in user input on c sharp -

string str = "Techie Delight";
        char ch = 'e';
 
        int freq = str.Count(f => (f == ch));
        Console.WriteLine(freq);

Comments

Submit
0 Comments